package extend;

public class CylibderTeast extends Cylinder{

    private double length;

    public  void Cylinder(double length){
        this.length=1;//初始值
    }


    public double getLength() {
        return length;
    }
    public void setLength(double length) {
        this.length = length;
    }


    public double finVolume(){
        double s2=length*getRadius()*getRadius();//调用父类半径
        return s2;
    }


    public static void main(String[] args){
        CylibderTeast p=new CylibderTeast();

        p.setRadius(4.2);//圆面积
        p.getRadius();
        p.findArea();
        System.out.println("半径："+p.getRadius()+"\n"+"圆的面积："+p.findArea());

        p.setLength(5.0);//圆柱面积
        p.getLength();
        p.finVolume();
        System.out.println("高："+p.getLength()+"\n 圆柱的面积："+p.finVolume());
    }
}
